package com.ibeeking.gmc.global.g.rest.controller.v1;


import com.ibeeking.gmc.global.g.rest.service.ITenantDataPushService;
import com.ibeeking.found.common.annotation.LoginUser;
import com.ibeeking.found.common.entity.CurrentUser;
import com.ibeeking.gmc.global.service.common.param.ScriptPushParam;
import com.ibeeking.nematos.constants.enums.OperateLogTypeEnum;
import com.ibeeking.nematos.log.annotation.Log;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @ClassName TenantDataPushController控制器
 * @Description 租户数据分发
 * @Author ibeeking
 * @Date 2021-03-02 09:07
 **/
@RestController
@RequestMapping("/g/tenantDataPush/v1")
public class TenantDataPushController {

    @Resource
    private ITenantDataPushService tenantDataPushServiceImpl;

    @Log(logType = OperateLogTypeEnum.MODIFY, describe = "执行脚本")
    @PostMapping(value = "/executeScript")
    public Boolean executeScript(@LoginUser CurrentUser currentUser, @RequestBody @Validated ScriptPushParam param) {
        return tenantDataPushServiceImpl.executeScript(currentUser.getId(), param);
    }

}
